#ifndef _STACK_H
#define _STACK_H

#define STACK_INIT_SIZE 100

//typedef int SELemType;
typedef char SELemType;

typedef struct aryStack{
	SELemType *top;  //stack top
	SELemType *base; //init NULL
	int stacksize; //size count by SELemType
}SqStack;

extern int InitStack(SqStack *s);
extern int DestroyStack(SqStack *s);

extern int InitStackAry(SqStack *s, SELemType* ary);
extern int DestroyStackAry(SqStack *s);

//set s to NULL stack
extern int ClearStack(SqStack *s);

//if stack is NULL, 
//return 1 if NULL; else return 0
extern int StackEmpty(SqStack *s);

//return item number
extern int StackLength(SqStack *s);


extern int GetTop(SqStack *s, SELemType* e);

extern int Push(SqStack *s, SELemType e);

extern int Pop(SqStack *s, SELemType *e);

#endif





